<?php

namespace Application\Model;

use Zend\Db\TableGateway\TableGateway,
    Zend\Db\Adapter\Adapter,
    Zend\Validator\Db\RecordExists;

class LinksTmp extends TableGateway {

    protected $table = 'tbl_region_links';

    public function __construct(Adapter $adapter) {
        parent::__construct($this->table, $adapter, null, null, null);
    }

    public function saveLinks($data){
        $exist = new RecordExists(
            array(
                'adapter' => $this->getAdapter(),
                'table'   => $this->table,
                'field'   => 'url_links',
            )
        );
        
        if(!$exist->isValid($data['url_links'])){
            $this->insert($data);
        }
    }
}